<!--
 This source file is part of the https://github.com/ColdGrub1384/Pisth open source project

 Copyright (c) 2017 - 2018 Adrian Labbé
 Licensed under Apache License v2.0

 See https://raw.githubusercontent.com/ColdGrub1384/Pisth/master/LICENSE for license information
-->

<meta name="viewport" content="width=device-width height=device-height initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="xterm.css" />
<script src="xterm.js"></script>
<script src="fit.js"></script>

<body style="background-color: transparent;">
    <div id="terminal" style="height: 100%; width: 100%;"></div>
    
    <script type="text/javascript">
        
        var console = "";
        
        // Create terminal
        var term = new Terminal();
        term.open(document.getElementById('terminal'));
        
        term.setOption("allowTransparency", true);
        term.setOption("theme", {background: "rgba(0,0,0,0)"});
        
        term.focus();
        
        // Change title
        term.on("title", function (title) {
            alert("changeTitle"+title);
        })
        
        // Bell
        setTimeout(function () {
            term.on("bell", function () {
                alert("bell");
            })
        }, 1000);
        
        function writeToTerm(text) {
            console = console+text;
            term.write(text);
        }
    
        function send(text) {
            alert("runCommand"+text);
        }
    </script>
</body>
